#ifndef        __COMMON_H__
#define        __COMMON_H__

int   iskanji1 ( unsigned char kanji1 );
int   strlen(char *string);
void  strhex(unsigned char *pSrc, char *pDest, char cSrcSize);
char  *memcpy(char *pDest, char *pSrc, unsigned long length);
char  *memcpyh(short *pDest, short *pSrc, unsigned long length);
void  memtoreg_h(unsigned long lPortNo, short *pSrc, unsigned long length);
void  memtoreg_l(unsigned long lPortNo, long *pSrc, unsigned long length);
float sqrt(float x);
void  _exit(void);

#define _UPPER        0x1    /* upper case letter */
#define _LOWER        0x2    /* lower case letter */
#define _DIGIT        0x4    /* digit[0-9] */
#define _SPACE        0x8    /* tab, carriage return, newline, */
                /* vertical tab or form feed */
#define _PUNCT        0x10    /* punctuation character */
#define _CONTROL      0x20    /* control character */
#define _BLANK        0x40    /* space char */
#define _HEX          0x80    /* hexadecimal digit */

#define isalpha(_c)    ( (_ctype+1)[_c] & (_UPPER|_LOWER) )
#define isupper(_c)    ( (_ctype+1)[_c] & _UPPER )
#define islower(_c)    ( (_ctype+1)[_c] & _LOWER )
#define isdigit(_c)    ( (_ctype+1)[_c] & _DIGIT )
#define isxdigit(_c)    ( (_ctype+1)[_c] & _HEX )
#define isspace(_c)    ( (_ctype+1)[_c] & _SPACE )
#define ispunct(_c)    ( (_ctype+1)[_c] & _PUNCT )
#define isalnum(_c)    ( (_ctype+1)[_c] & (_UPPER|_LOWER|_DIGIT) )
#define isprint(_c)    ( (_ctype+1)[_c] & (_BLANK|_PUNCT|_UPPER|_LOWER|_DIGIT) )
#define isgraph(_c)    ( (_ctype+1)[_c] & (_PUNCT|_UPPER|_LOWER|_DIGIT) )
#define iscntrl(_c)    ( (_ctype+1)[_c] & _CONTROL )
#ifndef __STDC__
#define toupper(_c)    ( (islower(_c)) ? _toupper(_c) : (_c) )
#define tolower(_c)    ( (isupper(_c)) ? _tolower(_c) : (_c) )
#endif
#define _tolower(_c)    ( (_c)-'A'+'a' )
#define _toupper(_c)    ( (_c)-'a'+'A' )
#define __isascii(_c)    ( (unsigned)(_c) < 0x80 )
#define __toascii(_c)    ( (_c) & 0x7f )

#define abs(x) ((x < 0) ? -x : x)

#endif    /*    __COMMON_H__    */
